package com.feng.springcloud.controller;

import org.springframework.beans.factory.annotation.Value;
//import lombok.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author fenggbinn
 * @create 2022/3/13 11:28
*/
@RestController
@RefreshScope
public class ConfigClientController {
    @Value("${config.info}")
    private String configInfo;

    //3355不能动态更新（不重启服务）配置中心的内容，3344可以动态更新
    @GetMapping("/configInfo")
    public String getConfigInfo(){
        return configInfo;
    }

    @Value("${config2.info}")
    private String configInfo2;

    @GetMapping("/configInfo2")
    public String getConfigInfo2(){
        return configInfo2;
    }
}
